import baseModel from './baseModel'

class userModel extends baseModel {

    constructor(options) {
        super(options);
    }
    // /user/token/{token}
    userToken(token) {
        let url = `/api/user/token/${token}`
        return this.$get(url)
    }

    userList(currentPage,pageSize){
        let url = `/api/user/getAll/${currentPage}/${pageSize} `;
        return this.$get(url)
    }

    userAdd(data){
        let url = `/api/user/insert`;
        return this.$post(url,data)
    }

    userRole(){
        let url =`/api/user/getAllRole`;
        return this.$get(url)
    }
    
    getAllIdentity() {
        let url = `/api/user/getAllIdentity`;
        return this.$get(url)
    }
	userDelete(data){
		let url = `/api/user/remove/${data}/`;
		 return this.$get(url)
	}
	userEdit(data) {
    	let url = `/api/user/edit`;
    	return this.$post(url,data)
    }

    //修改用户密码user/edit-password type=0 超级管理员更改其他用户密码
    //type=1 更改自己密码
    editPassword(data){
        let url = `/api/user/edit-password`;
        return this.$post(url,data)
    }

 
}


export default userModel;